package com.hfi.qinxiaobo151;

import org.junit.Test;

/**
 * @author ChangLiang
 * @date 2018/9/3
 */
public class Item1_7 {

    @Test
    public void test() {
        int count =0;
        for(int i=0;i<10;i++){
            count=count++;
        }
        System.out.println("count="+count);
    }
}

class Mock{
    public static void main(String[] args) {
        int count =0;
        for(int i=0;i<10;i++){
            count=mockAdd(count);
        }
        System.out.println("count="+count);
    }

    public static int mockAdd(int count){
        //先保存初始值
        int temp =count;
        //做自增操作
        count = count+1;
        //返回原始值
        return temp;
    }
}